import { PropsWithChildren } from 'react'
import Taro, { useLaunch,useDidShow } from '@tarojs/taro'

import './app.scss'


function App({ children }: PropsWithChildren) {

  useLaunch(() => {
    console.log('App launched.')
    
    // if (!Taro.getStorageSync('userInfo')?.token) {
    //   Taro.reLaunch({
    //     url: '/pages/login/index'
    //   })
    // }

  })
  useDidShow(()=>{
    console.log('useDidShow',Taro.getCurrentPages())
  })
  // Taro.showShareMenu({
  //   withShareTicket: true,
  //   // @ts-ignore
  //   menus: ['shareAppMessage', 'shareTimeline'],
  //   showShareItems: ['shareAppMessage', 'shareTimeline'],
  // });

  // children 是将要会渲染的页面
  return children
}

export default App
